// pages/testPages/testRootPortal/testRootPortal.js

import moment from "../../../tools/moment"
Page({

  /**
   * 页面的初始数据
   */
  data: {
    showPop: false,
    goodsData: {
      goodsSku: [{
        name: "真沐浴雪松沐浴露500ml*3",
        isSellout: false,
        saveCount: 100
      },
      {
        name: "真沐浴雪松沐浴露500ml+雪松身体乳300ml",
        isSellout: true,
        saveCount: 0
      },
      {
        name: "雪松沐浴露500ml",
        isSellout: false,
        saveCount: 100
      },
      {
        name: "雪松沐浴露1500ml",
        isSellout: false,
        saveCount: 100
      },
      ]
    },
    countTimestamp: 0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    const momentObj = moment('2024-01-30 14:30:00');
    const timestamp = momentObj.unix();
    // const timestampMs = momentObj.valueOf(); //毫秒级
    console.log("JJLog:未来时间戳是:" + timestamp);
    this.setData({
      countTimestamp: timestamp
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  showPopAction() {
    console.log("JJLog:点击来了====")
    this.setData({
      showPop: !this.data.showPop
    })
  },
  //关闭选择商品弹窗:
  closeGoodsSelectPop() {
    this.setData({
      showPop: false,
    })
  },
  hidePopAction() {
    this.setData({
      showPop: false,
    })
  },
  simpleSortChange(e) {
    console.log(e);
  },
})